package cn.arikeky.service.impl;

import cn.arikeky.domain.Fiction;
import cn.arikeky.mapper.FictionMapper;
import cn.arikeky.service.FictionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class FictionServiceImpl implements FictionService {

    @Autowired
    private FictionMapper fictionMapper;

    @Override
    public List<Fiction> findFAll() {
        return fictionMapper.findFAll();
    }

    @Override
    @Transactional
    public void addF(Fiction fiction) {
        fictionMapper.addF(fiction);
    }

    @Override
    @Transactional
    public void updateF(Fiction fiction) {
        fictionMapper.updateF(fiction);
    }

    @Override
    @Transactional
    public void deleteF(Long id) {
        fictionMapper.deleteF(id);
    }

    @Override
    public Fiction findFById(Long id) {
        return fictionMapper.findFById(id);
    }
}
